package com.chase.passwordmaster.mine.setting

import android.content.Context
import android.content.Intent
import android.os.Bundle
import android.view.View
import androidx.appcompat.app.AppCompatActivity
import androidx.constraintlayout.widget.ConstraintLayout
import com.chase.passwordmaster.R
import com.chase.passwordmaster.mine.setting.pass.SettingPassActivity
import com.chase.passwordmaster.utils.useDarkStatusBar
import com.chase.passwordmaster.utils.useImmersingNavigator

class SettingActivity : AppCompatActivity() {

    companion object {
        fun actionStart(context: Context) {
            val intent = Intent(context, SettingActivity::class.java)
            context.startActivity(intent)
        }
    }

    private lateinit var cpBack: View
    private lateinit var cpSetPass: ConstraintLayout

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_setting)

        cpBack = findViewById(R.id.back_setting)
        cpSetPass = findViewById(R.id.set_pass_setting)

        useDarkStatusBar()
        useImmersingNavigator()

        initCPSetPass()
        initCPBack(cpBack = cpBack)
    }

    private fun initCPBack(cpBack: View) {
        cpBack.setOnClickListener { onBackPressed() }
    }

    private fun initCPSetPass() {
        cpSetPass.setOnClickListener {
            SettingPassActivity.actionStart(this)
        }
    }
}